Handle bmps with more than 8 bits per channel. (#172584, David Costanzo)
authorMatthias Clasen <mclasen@redhat.com>
Fri, 22 Dec 2006 06:19:38 +0000 (06:19 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 22 Dec 2006 06:19:38 +0000 (06:19 +0000)
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * io-bmp.c (decode_bitmasks): Handle bmps
        with more than 8 bits per channel.  (#172584,
        David Costanzo)

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-bmp.c

index 9fb0e1e4c53113d8dc2d868975ca5134b06fe93d..81cb1cff791c8ef92df55e38d48893622a7d744c 100644 (file)
@@ -1,5 +1,9 @@
 2006-12-22  Matthias Clasen  <mclasen@redhat.com>
 
+       * io-bmp.c (decode_bitmasks): Handle bmps
+       with more than 8 bits per channel.  (#172584,
+       David Costanzo)
+
        * io-bmp.c: Handle offsets more carefully. (#172188,
        David Costanzo)
 
index 83e189d6ecd0bc7b73fe6b030994dd74caa09c2f..13d9738013eef38639c8f8785308424bfdeed2eb 100644 (file)
@@ -605,6 +605,23 @@ decode_bitmasks (guchar *buf,
                 }
        }
 
+        if (State->r_bits > 8) {
+          State->r_shift += State->r_bits - 8;
+          State->r_bits = 8;
+        }
+        if (State->g_bits > 8) {
+          State->g_shift += State->g_bits - 8;
+          State->g_bits = 8;
+        }
+        if (State->b_bits > 8) {
+          State->b_shift += State->b_bits - 8;
+          State->b_bits = 8;
+        }
+        if (State->a_bits > 8) {
+          State->a_shift += State->a_bits - 8;
+          State->a_bits = 8;
+        }
+
        State->read_state = READ_STATE_DATA;
        State->BufferDone = 0;
        State->BufferSize = State->LineWidth;